cmake_minimum_required (VERSION 2.8.9)
project (librelancernatives)
set(CMAKE_BUILD_TYPE release)
# libbulletc should really set this. work around for older GCC+CMake
if (CMAKE_VERSION VERSION_LESS "3.1")
    if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
        set (CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
    endif ()
else ()
    set (CMAKE_C_STANDARD 99)
endif ()
set(LIBOUTPUTDIR ${CMAKE_BINARY_DIR}/binaries)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBOUTPUTDIR})
# make it work on windows too
if(MSVC_IDE)
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${LIBOUTPUTDIR}")
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${LIBOUTPUTDIR}")
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${LIBOUTPUTDIR}")
endif()
add_subdirectory(src/cimgui_ext cimgui)
add_subdirectory(src/lancerdecode lancerdecode)
add_subdirectory(src/pangogame pangogame)
add_subdirectory(extern/BulletSharpPInvoke/libbulletc bulletc)

# nvtt has different project structure
# binary handled by nuget for windows
if(NOT WIN32)
	add_subdirectory(src/nvtt_shared nvttso)
endif()
